var IntornoMenu = (function($) { var BRAEK_POINT = 750; var init = function() { // MENU CONTENT $('.menu-nav a').on('click',function(e) { e.preventDefault(); var ww = document.documentElement.clientWidth; var data_menu = $(this).attr('data-menu'); if (data_menu != 'open-menu') { var pos = (ww < BRAEK_POINT) ? $('.'+data_menu).offset().top - parseInt($('.'+data_menu).css('padding-top')) - parseInt($('.'+data_menu).find('.section-title').height()) - parseInt($('header').height()) : $('.'+data_menu).offset().top - parseInt($('header').height()); $('html, body').dequeue(); $('html, body').animate({ scrollTop: pos }, 850, 'easeInOutQuart'); $('.menu-nav').removeClass('open'); } else { $('.menu-nav').addClass('open'); } }) // GALLERY $('.gallery-items').slick({ dots: true, infinite: true, speed: 300, slidesToShow: 1, centerMode: true, variableWidth: true }); } return { init: init, }; }(jQuery)); /** * Initialize * */ $(function(){ IntornoMenu.init(); }); /** * Easing Plugins * */ $.extend($.easing, { easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, });